//
//  SpeechManager.h
//  AudioConvertOC
//
//  Created by xyanl on 2025/4/26.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


typedef void(^CompleteBlock)(BOOL isSuccess, NSString *result);

@protocol SpeechManagerDelegate <NSObject>

- (void)didFinishRecognition:(NSString *)result isSuccess:(BOOL)isSuccess;

@end

@interface SpeechManager : NSObject

@property (nonatomic, weak) id<SpeechManagerDelegate> delegate;

+ (instancetype)shareInstance;

/// 请求语音识别的权限
- (void)requestAuthorization;

/// 创建转写
/// - Parameters:
///   - language: 转写的语言 中文：zh_CN，英文：en_US，俄语：ru-RU
///   - url: 音频文件路径
- (void)createSpeech:(NSString *)language url:(NSString *)url;
- (void)createSpeech:(NSString *)language url:(NSString *)url completion:(void (^)(BOOL success, NSString *result))completion;

@end

NS_ASSUME_NONNULL_END
